
N = size(Y,1)
r = ksr(1:N,Y,20)

figure(6)
plot(Y,'bo')
hold all
plot(r.x,r.f,'r--')


%%
x = 1:100;
y = sin(x/10)+(x/50).^2;
yn = y + 0.2*randn(1,100);
r=ksr(x,yn);
plot(x,y,'b-',x,yn,'co',r.x,r.f,'r--','linewidth',2)
legend('true','data','regression','location','northwest');
title('Gaussian kernel regression')